﻿using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using UtilsBase;
using UtilsORM.MySqlData;
using UtilsORM;
using UtilsORM.MySqlData;

namespace ServiceWeb.DBGateway
{
    public class DBManageSystemLog
    {


        public void WriteLog(MagerLoginInfo magerLoginInfo, string content)
        {
            try
            {
                bs_manage_system_log system_Log = new bs_manage_system_log();
                system_Log.l_cu_guid = magerLoginInfo.user_guid;
                system_Log.l_cu_name = magerLoginInfo.user_Name;
                system_Log.l_c_guid = magerLoginInfo.userCompanyGuid;
                //system_Log.l_ip = UtilsMachineInfo.GetIP(httpContext);
                system_Log.l_addtime = DateTime.Now;
                system_Log.l_content = content;
                system_Log.l_system = "后台";

                EFYihongIotContext ef = new EFYihongIotContext();
                ef.bs_manage_system_log.Add(system_Log);
                ef.SaveChanges();
            }
            catch (Exception ex)
            {
                // BaseClass.Log4netFactory.GetLogger(this.GetType().ToString()).WriteError(ex.Message);
            }
        }


    }
}